var express = require('express');
var router = express.Router();

var api = require("../../../utils/api");

//日程打点日期列表
router.get('/datelist', function (req, res, next) {
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/datelist.json";
    res.json(api.api.request(path));
});

//获取日程列表
router.get('/', function (req, res, next) {
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/scheduals.json";
    res.json(api.api.request(path));
});
//获取日程详情
router.get('/10001',function(req,res,next){
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/schedetail.json";
    res.json(api.api.request(path));
});

//签到
router.post('/locations',function(req,res){
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/index.json";
    res.json(api.api.request(path));
});

//删除日程
router.delete('/10001',function(req,res,next){
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/index.json";
    res.json(api.api.request(path));
});

//获取客户详情
router.get('/details/1', function (req, res,next) {
    api.api.reqBody(req);
    var path = api.api.urltoPath(req.baseUrl) + "/detail.json";
    res.json(api.api.request(path));
  });

module.exports = router;